package com.atjava.webspider.consts;


public class Const {
	
	public static final String DATA_NAME_SEPARATOR = "－";
	
	public static final String DATA_NUM_VAR_NAME = "datanum";
	
	public static final String APP_PATH = System.getProperty("user.dir");

	public static final String APP_CONFIG_PATH = System.getProperty("user.dir") + "/config/global.xml";
	
	public static final String DB_CONFIG_PATH = System.getProperty("user.dir") + "/config/database.xml";
	
	public static final String SITE_CONFIG_PATH = System.getProperty("user.dir") + "/config/sites.xml";
	
	public static final String TASK_HOME = System.getProperty("user.dir") + "/tasks";
	
	public static final String TEMPLATE_HOME = System.getProperty("user.dir") + "/template";
	
	public static final int TASK_STATE_SAVED = 0;
	
	public static final int TASK_STATE_WATTING = 1;
	
	public static final int TASK_STATE_DOWNING = 2;
	
	public static final int TASK_STATE_PAUSED = 3;
	
	public static final int TASK_STATE_STOP = 4;
	
	public static final int TASK_STATE_FINISHED = 5;
	
	public static final String getTaskStateName(int state){
		switch (state) {
		case TASK_STATE_SAVED:
			return "已保存";
		case TASK_STATE_WATTING:
			return "等待中";
		case TASK_STATE_DOWNING:
			return "正在下载";
		case TASK_STATE_PAUSED:
			return "已暂停";
		case TASK_STATE_STOP:
			return "已停止";
		case TASK_STATE_FINISHED:
			return "已完成";
		default:
			return "未知";
		}
	};
	
}
